package demo1;
interface IRun {
    void run();
}
interface ISwim {
    void swim();
}
interface IJump {
    void  jump();
}

abstract class Animals {
    public String name;
    public int age;

    public Animals(String name, int age) {
        this.name = name;
        this.age = age;
    }
    abstract void eat();
}
class Dog extends Animals implements IRun,IJump{
    public Dog(String name, int age) {
        super(name, age);
    }

    public void run() {
        System.out.println(name+"正在跑");
    }
    public void jump() {
        System.out.println(name+ "正在跳");
    }
    void eat() {
        System.out.println(name+ "正在吃饭");
    }
}
public class HE {
    public static void func(IRun irun,Animals animals) {
        irun.run();
        animals.eat();
    }
    public static void main(String[] args) {
        func(new Dog("小黑",15),new Dog("阿旺",10));

    }
}
